﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:wintheme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">

    <!-- DARK BACKGROUND -->
    <LinearGradientBrush x:Key="DarkBackground" StartPoint="0,0" EndPoint="1,1">
        <GradientStop Offset="0" Color="#FF333344"></GradientStop>
        <GradientStop Offset="1" Color="#FF666677"></GradientStop>
    </LinearGradientBrush>
    <!-- LIGHT BACKGROUND -->
    <LinearGradientBrush x:Key="LightBackground" StartPoint="0,0" EndPoint="1,1">
        <GradientStop Offset="0" Color="#FF9999AA"></GradientStop>
        <GradientStop Offset="1" Color="#FFDDDDFF"></GradientStop>
    </LinearGradientBrush>
    <!-- CONTROL BACKGROUND -->
    <SolidColorBrush x:Key="BaseColor" Color="#99000000"></SolidColorBrush>

    <!-- GLASS EFFECT -->
    <LinearGradientBrush x:Key="GlassFX" StartPoint=".5,0" EndPoint=".5,.5">
        <GradientStop Offset="1" Color="#33111111"></GradientStop>
        <GradientStop Offset="1" Color="#33000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlassFXDisabled" StartPoint=".5,0" EndPoint=".5,.5">
        <GradientStop Offset="1" Color="#33BBBBBB"></GradientStop>
        <GradientStop Offset="1" Color="#11000000"></GradientStop>
    </LinearGradientBrush>

    <!-- GLOW EFFECT -->
    <RadialGradientBrush x:Key="GlowFX" GradientOrigin=".5,1" Center=".5,1">
        <GradientStop Offset="0" Color="#990000FF"></GradientStop>
        <GradientStop Offset=".5" Color="#660000DD"></GradientStop>
        <GradientStop Offset="1" Color="#33000000"></GradientStop>
    </RadialGradientBrush>
    <RadialGradientBrush x:Key="GlowFXPressed" GradientOrigin=".5,1" Center=".5,1">
        <GradientStop Offset="0" Color="#660000CC"></GradientStop>
        <GradientStop Offset="1.2" Color="#33FFFFFF"></GradientStop>
    </RadialGradientBrush>
    <LinearGradientBrush x:Key="GlowFXRowPressed">
        <GradientStop Offset="0" Color="#660000FF"></GradientStop>
        <GradientStop Offset=".7" Color="#660000AA"></GradientStop>
        <GradientStop Offset="1" Color="#66000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXProgress">
        <GradientStop Offset="0" Color="#660099FF"></GradientStop>
        <GradientStop Offset=".99" Color="#660022AA"></GradientStop>
        <GradientStop Offset="1" Color="#00000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXProgressAnimated" MappingMode="RelativeToBoundingBox">
        <GradientStop Offset="0" Color="#00000000"></GradientStop>
        <GradientStop Offset=".50" Color="#660099FF"></GradientStop>
        <GradientStop Offset="1" Color="#00000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXTabSelected" StartPoint=".5,1" EndPoint=".5,0">
        <GradientStop Offset="0" Color="#33DDDDDD"></GradientStop>
        <GradientStop Offset="1" Color="#332222FF"></GradientStop>
    </LinearGradientBrush>

    <!-- WINDOWS-->
    <!-- Fill Brushes -->

    <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#AAA" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#BBB" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="0.1"/>
                <GradientStop Color="#EEE" Offset="0.9"/>
                <GradientStop Color="#FFF" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />

    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />

    <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" />

    <!-- Border Brushes -->

    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#777" Offset="0.0"/>
                <GradientStop Color="#000" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#444" Offset="0.0"/>
                <GradientStop Color="#888" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

    <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />

    <!-- Miscellaneous Brushes -->
    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />

    <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />
    <!-- Windows Ende-->
    
    
    
    <!-- GLOW ANIMATION -->
    <Storyboard x:Key="GlowOut">
        <DoubleAnimation x:Name="AnimGlowOut" BeginTime="00:00:00" 
                   Storyboard.TargetName="GlowRectangle"
                   Duration="00:00:00.250" 
                   From="1" To="0"
                   Storyboard.TargetProperty="Opacity">
        </DoubleAnimation>
    </Storyboard>
    <Storyboard x:Key="GlowIn">
        <DoubleAnimation x:Name="AnimGlow" 
                   BeginTime="00:00:00" 
                   Storyboard.TargetName="GlowRectangle"
                   Duration="00:00:00.250" 
                   From="0" To="1" 
                   Storyboard.TargetProperty="Opacity">
        </DoubleAnimation>
    </Storyboard>

    
    <!-- BUTTON -->
    <Style TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Name="border" Background="{x:Null}">
                        <ContentPresenter Name="content" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              Margin="{TemplateBinding Padding}" 
                                              RecognizesAccessKey="True" 
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                   
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" Value=".5"></Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value=".5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="content" Property="RenderTransform" >
                                <Setter.Value>
                                    <ScaleTransform ScaleX="0.95" ScaleY="0.95" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Slider -->

    <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="Width" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Ellipse 
          Name="Ellipse" 
          Fill="{StaticResource NormalBrush}"
          Stroke="{StaticResource NormalBorderBrush}"
          StrokeThickness="1" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DarkBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TickBar 
      Name="TopTick"
      SnapsToDevicePixels="True" 
      Placement="Top"
      Fill="{StaticResource GlyphBrush}"
      Height="4"
      Visibility="Collapsed" />
            <Border 
      Name="TrackBackground"
      Margin="0"
      CornerRadius="2" 
      Height="4"
      Grid.Row="1"
      Background="{StaticResource LightBrush}" 
      BorderBrush="{StaticResource NormalBorderBrush}"
      BorderThickness="1" />
            <Track Grid.Row="1" Name="PART_Track">
                
                <Track.Thumb>
                    <Thumb Style="{StaticResource SliderThumbStyle}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource SliderButtonStyle}"
           />
                </Track.IncreaseRepeatButton>
            </Track>
            <TickBar 
      Name="BottomTick"
      SnapsToDevicePixels="True" 
      Grid.Row="2"
      Fill="{TemplateBinding Foreground}"
      Placement="Bottom"
      Height="4"
      Visibility="Collapsed" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Opacity" Value=".5"></Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>


    <Style TargetType="{x:Type Slider}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="MinWidth" Value="104" />
                <Setter Property="MinHeight" Value="21" />
                <Setter Property="Template" Value="{StaticResource HorizontalSlider}" />
            </Trigger>
            
        </Style.Triggers>
    </Style>

    <!-- LISTBOX -->
    <Style x:Key="{x:Type ListBox}" TargetType="ListBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="95"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Border   Name="Border" Background="{StaticResource BaseColor }"
                        BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" CornerRadius="5">
                        <ScrollViewer  Margin="0" Focusable="false">
                            <StackPanel Margin="5" IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- SCROLLBAR -->

    <Style x:Key="ScrollThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="tmplScrollThumb">
                    <Grid>
                        
                        <Border CornerRadius="2"  Background="#FF817C7C" Opacity=".6">
                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="VerticalScroll" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.00001*" />
            </Grid.RowDefinitions>
            <Border Grid.RowSpan="3" CornerRadius="3" BorderBrush="{x:Null}" BorderThickness="1" Opacity=".6" />
            <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="True">
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollThumb}"  />
                </Track.Thumb>
            </Track>
            </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="HorizontalScroll" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.00001*" />
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3" CornerRadius="3" BorderBrush="{x:Null}" BorderThickness="1" Opacity=".6" />
            <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
                
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollThumb}"  />
                </Track.Thumb>
            </Track>
        </Grid>
    </ControlTemplate>
    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="5" />
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Margin" Value="1,3" />
              <Setter Property="Template" Value="{StaticResource VerticalScroll}" /> 
            </Trigger>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto" />
                <Setter Property="Height" Value="5" />
                <Setter Property="Margin" Value="1,3" />
                <Setter Property="Template" Value="{StaticResource HorizontalScroll}" />
            </Trigger>
        </Style.Triggers>
    </Style>        
</ResourceDictionary>